//
//  DataCenter.h
//  51-Tour
//
//  Created by xiang ying on 14-3-21.
//  Copyright (c) 2014年 xiang ying. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UserDTO.h"

#define CACHEDIRECTOR [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]

//临时语音文件夹
#define AUDIOPATH     [NSString stringWithFormat:@"%@/amr",CACHEDIRECTOR]
//临时zip包文件夹
#define ZIPCACHEPATH     [NSString stringWithFormat:@"%@/zip",CACHEDIRECTOR]
//鸟瞰图文件夹
#define MAPPATH     [NSString stringWithFormat:@"%@/map",CACHEDIRECTOR]


#define DOCUMENTPATH       NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]
//下载完zip的文件夹
#define ZIPDOCUMENTPATH [NSString stringWithFormat:@"%@/zip",DOCUMENTPATH]
//解压zip文件的文件夹
#define UNZIPDOCUMENTPATH [NSString stringWithFormat:@"%@/unzip",DOCUMENTPATH]

//数据库文件地址
#define DBPATH [NSString stringWithFormat:@"%@/51tour.db",DOCUMENTPATH]
//推送消息存储地址
#define MSGPATH [NSString stringWithFormat:@"%@/msg",DOCUMENTPATH]
//头像
#define ICONPATH [NSString stringWithFormat:@"%@/icon.png",DOCUMENTPATH]
//证件照
#define WORKICONPATH [NSString stringWithFormat:@"%@/workicon.png",DOCUMENTPATH]


#define TIP_SUCCESS [[DataCenter instance] getStringForKey:@"success"]
#define TIP_ERROR   [[DataCenter instance] getStringForKey:@"failed"]
typedef enum {
    unknow,
    en_us,      //
    zh_cn,
}language_type;



//分享
//新浪微博分享
#define kAppKey             @"184037917"
#define kAppSecret          @"d951803aa81fb25e9f3114c24e1ff8d0"
#define kAppRedirectURI     @"http://cabbao.com"

//weixin
#define wxKey               @"wx1f1b6a4fb2bb98ea"
#define wxSecret            @"fe108735440d1d9d5fbc997cd8a8104b"

//qq
#define qqKey               @"1101265285"

@interface DataCenter : NSObject

@property(nonatomic,retain)UserDTO *user;

@property(nonatomic,strong)NSString *adUrl;

@property(nonatomic,strong)NSString *shareText;

+(instancetype)instance;

//is first time load
-(BOOL)isFirstload;

//get person info
-(void)loadUserInfo;

//set person info
-(void)setUserInfo:(UserDTO*)dto;

//set language
-(void)setLanguangeType:(language_type)type;

//
-(language_type)getLanguageType;

//get allvalues of current language
-(void)getLanguageValue:(language_type)type;

//get the string for key of the language
-(NSString*)getStringForKey:(NSString*)key;

@end
